package com.qf.handerException;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author bss
 * @version V1.0
 * @Project maven
 * @Package com.qf.handerException
 * @Description:
 * @Date 2022/10/8 19:57
 */
@RestControllerAdvice
public class MyHandlerException03 {


    @ExceptionHandler({
            RuntimeException.class
    })
    public Object handleRuntimeException(RuntimeException e){
        e.printStackTrace();
        return "RuntimeError";
    }


    @ExceptionHandler({
            Exception.class
    })
    public Object otherException(Exception e){
        e.printStackTrace();
        return "otherError";
    }
}
